﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace LAN_Party_Manager
{
    [Serializable]
    public class Player
    {
        public static int activePlayers;
        public static List<Player> players = new List<Player>();
        private string name;
        private int elo;
        private bool active;
        private int team;
        public static int team1elo;
        public static int team2elo;
        private int winningMin;
        public static int gameTime;
        private int wins;

        public Player(string name, bool active)
        {
            this.name = name;
            this.active = active;
            this.elo = 1200;
            this.team = 0;
            this.winningMin = 0;
            Player.activePlayers++;
        }

        public void setActive()
        {
            active = true;
            Player.activePlayers++;
        }
        public void setInactive()
        {
            active = false;
            Player.activePlayers--;
        }
        public void setElo(int newElo)
        {
            this.elo = newElo;
        }
        public string getName()
        {
            return this.name;
        }
        public int getElo()
        {
            return this.elo;
        }
        public bool isActive()
        {
            return this.active;
        }
        public int getTeam()
        {
            return this.team;
        }
        public void setTeam(int team)
        {
            this.team = team;
        }
        public int getTeamElo()
        {
            if (this.getTeam() == 1)
                return Player.team1elo;
            else if (this.getTeam() == 2)
                return Player.team2elo;
            else
                return 0;
        }
        public int getEnemyTeamElo()
        {
            if (this.getTeam() == 1)
                return Player.team2elo;
            else if (this.getTeam() == 2)
                return Player.team1elo;
            else
                return 0;
        }
        public int getTime()
        {
            return this.winningMin;
        }
        public void addWin()
        {
            this.wins++;
        }
        public void addTime(int time)
        {
            this.winningMin += time;
        }
        public float getTimeRatio()
        {
            return this.wins / this.winningMin;
        }
    }

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
            
        }
    }
}
